#include <amxmodx>
#include <fun>
#include <rpgx>

#define SetGravity(%1) set_user_gravity(%1, 1.0 - (0.05 * RPGx_GetUpgradeLevel(%1, upgrade_id)))

new upgrade_id;

public plugin_init()
	register_plugin("Gravity- RPGx Upgrade", "2.1", "roflmao456");

public RPGx_OnPluginReady()
	upgrade_id = RPGx_MakeUpgrade("Gravity-", 10, 10, 15);

public RPGx_OnPlayerSpawn(id)
	SetGravity(id);

public RPGx_OnUpgradePurchase(id, upgrade, newlevel)
	if(upgrade == upgrade_id)
		SetGravity(id);

public RPGx_OnUpgradeSell(id, upgrade, newlevel)
	if(upgrade == upgrade_id)
		SetGravity(id);